;4、写一个优化的程序片段，统计字符串的长度，设字符串以0结尾



assume cs:code,ds:data


assume cs:code,ds:data

data segment 
string db "hello world", 0

data ends


code segment 

start:
		mov ax, data
		mov ds, ax
		;
		mov ax, offset string
		mov si, ax
		sub si, 1
		xor ax, ax
		
judge:
		inc si
		cmp byte ptr [si], 0
		jz exit


count:  inc ax
		jmp judge
		


exit:
		mov ax, 4c00h
		int 21h

code ends
		end start